import request from '@/untils/request'

// 查询库区
export const getKqList = (params) => request.get('/api/location/pageDetail', { params })
// 添加库区
export const addKq = (data) => request.post('/api/area', data)
// 添加库区列表
export const myKw = (params) => request.get('/api/warehouse/list', { params })
// 查询id
export const searchId = (id) => request.get(`/api/area/${id}`)

// 编辑
export const editKq = (data) => request.put('/api/location', data)
// 删除库位
export const delKq = (id) => request.delete('/api/location?ids[]=' + id)
// 导出文件
// export const excle = () => request.get('/template/areaTemplate.xlsx')
export const excle = () => request({
  url: '/template/areaTemplate.xlsx',
  responseType: 'blob'
})
// 导入文件
export const importExcel = (formFile) => request({
  method: 'post',
  url: '/api/location/upload',
  data: formFile
})
// 一级列表
export const getone = () => request.get('/api/warehouse/list?status=1')
// 二级 // 查询全部

export const List = (params) => request.get('/api/area/list', { params })
// 编号
export const getCode = () => request.get('/api/codeFactory/next/KW')
// 提交接口
export const add = (data) => request.post('/api/location', data)

// 编辑获取信息接口
export const getEdit = (id) => request.get(`/api/location/${id}`)

// 编辑提交接口
export const editSubmit = (data) => request.put('/api/location', data)
